#pragma once
//////////////////////////////////////////////////////////////////////////
using namespace System::Windows::Forms;
using namespace System::Drawing;
//////////////////////////////////////////////////////////////////////////
NAMESPACE_BEGIN_UI
//////////////////////////////////////////////////////////////////////////
public ref class HistogramViewer : public Control
{
public:
	HistogramViewer(void);

protected:
	/// <summary>
	/// Clean up any resources being used.
	/// </summary>
	~HistogramViewer()
	{
		if (components != nullptr)
		{
			delete components;
		}
	}

	virtual void OnPaint(PaintEventArgs^ pe) override;

private:
	/// <summary>
	/// Required designer variable.
	/// </summary>
	System::ComponentModel::IContainer^ components;

	/// <summary>
	/// Required method for Designer support - do not modify 
	/// the contents of this method with the code editor.
	/// </summary>
private:
	void InitializeComponent()
	{
		components = gcnew System::ComponentModel::Container();
	}

public:
	property ManagedHistogram^ Histogram
	{
		void set(ManagedHistogram^ hist)
		{
			m_refHistogram = hist;
			this->Invalidate();
		}
	}

private:
	ManagedHistogram^				m_refHistogram;
};
//////////////////////////////////////////////////////////////////////////
NAMESPACE_END_UI
//////////////////////////////////////////////////////////////////////////